<template>
    <div class="layerRtb layerRtb-threecolumn">
        <three-title :title="{name:'当阶'}"></three-title>
        <div class="layerRtb-scroll thinScroll" v-scrollHeight="137">

            <div class="analyItem">
                <p class="analyItemTit tx-center">限制</p>
                <div class="analyItemCon">
                    <p class="col-md-3">
                        <span class="cLightGray pr8">保金</span>
                        <span>{{(upGrade.leDeposit/10000).toFixed(2)}}万</span>
                    </p>
                    <p class="col-md-3">
                        <span class="cLightGray pr8">单限</span>
                        <span>{{(upGrade.leReceiptNum/10000).toFixed(2)}}万</span>
                    </p>
                    <p class="col-md-3">
                        <span class="cLightGray pr8">总限</span>
                        <span>{{(upGrade.leReceiptMoney/10000).toFixed(2)}}万</span>
                    </p>
                    <p class="col-md-3">
                        <span class="cLightGray pr8">个限</span>
                        <span>{{upGrade.leReceiptAmount}}</span>
                    </p>
                </div>
            </div>

                  <div class="analyItem" v-if="raining" @click="clickFourShow(0)">
                <p class="analyItemTit tx-center">培训</p>
                <div class="analyItemCon">
                    <p class="col-md-6">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{rainingNum}}</span>
                    </p>
                    <p class="col-md-6">
                        <span class="cLightGray pr8">标准</span>
                        <span>一次面授</span>
                    </p>
                </div>
            </div>

            <div class="analyItem" v-if="workers">
                <p class="analyItemTit tx-center">工人</p>
                <div class="analyItemCon">
                    <p class="col-md-12">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{workersNum}}</span>
                    </p>
                </div>
            </div>

               <div class="analyItem" v-if="jf">
                <p class="analyItemTit tx-center">积分</p>
                <div class="analyItemCon">
                    <p class="col-md-12">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{jfNum}}</span>
                    </p>
                </div>
            </div>


            <div class="analyItem" v-if="securityOfficer">
                <p class="analyItemTit tx-center">证书</p>
                <div class="analyItemCon">
                    <p class="col-md-12">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{securityOfficerNum}}</span>
                    </p>
                </div>
            </div>

            <div class="analyItem" v-if="comPlete">
                <p class="analyItemTit tx-center">成就</p>
                <div class="analyItemCon">
                    <p class="col-md-12">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{(upGrade.leComplete/10000).toFixed(2)}}万</span>
                    </p>
                </div>
            </div>
            <div class="analyItem"  v-if="orderRates">
                <p class="analyItemTit tx-center">产值比</p>
                <div class="analyItemCon">
                    <p class="col-md-12">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{orderRatesNum}}</span>
                    </p>
                </div>
            </div>
                        <div class="analyItem" v-if="evaluation" >
                <p class="analyItemTit tx-center">项目好评</p>
                <div class="analyItemCon">
                    <p class="col-md-12">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{evaluationNum}}</span>
                    </p>
                </div>
            </div>

                        <div class="analyItem" v-if="rp">
                <p class="analyItemTit tx-center">人评</p>
                <div class="analyItemCon">
                    <p class="col-md-12">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{rpNum}}</span>
                    </p>
                </div>
            </div>


            <div class="analyItem"  v-if="cp">
                <p class="analyItemTit tx-center">材评</p>
                <div class="analyItemCon">
                    <p class="col-md-12">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{cpNum}}</span>
                    </p>
                </div>
            </div>

            <div class="analyItem" v-if="zp">
                <p class="analyItemTit tx-center">质评</p>
                <div class="analyItemCon">
                    <p class="col-md-12">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{zpNum}}</span>
                    </p>
                </div>
            </div>
               <div class="analyItem" v-if="xp">
                <p class="analyItemTit tx-center">现评</p>
                <div class="analyItemCon">
                    <p class="col-md-12">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{xpNum}}</span>
                    </p>
                </div>
            </div>

        </div>
        <div class="layerRtb-footer">
            <div class="analyItem">
                <p class="analyItemTit tx-center">综合</p>
                <div class="analyItemCon">
                    <p class="fr col-md-3">
                        <span class="cLightGray"></span>
                        <span class="cGreen fz14 bold"></span>
                    </p>
                </div>
            </div>

        </div>
                    <!-- 四段渲染容器 -->
    <transition-group class="animated faster" enter-active-class="animated faster slideInRight" leave-active-class="animated faster slideOutRight">
        <!-- 问题 threeresultDetail -->
        <rx-fourTrain v-if="fourIndex === 0" :key="0"></rx-fourTrain>
    </transition-group>
    </div>
</template>
<script>
import { mapGetters } from 'vuex'
import rxFourTrain from './fourTrain'
export default {
    data () {
        return {
            upGrade: {},
            orderRates: false, // 订单率
            orderRatesNum: '',
            evaluation: false, // 评价
            evaluationNum: 0,
            deliveryRates: false, // 配送率
            deliveryRatesNum: '',
            workers: false, // 工人
            workersNum: 0,
            delayRate: false, // 延期率
            delayRateNum: '',
            deferralRate: false, // 款项延期率
            deferralRateNum: '',
            raining: false, // 培训
            rainingNum: '',
            securityOfficer: false, // 安全员证
            securityOfficerNum: '',
            ziti: false,
            zitiNum: '',
            xp: true,
            xpNum: '',
            zp: true,
            zpNum: '',
            cp: true,
            cpNum: '',
            rp: true,
            rpNum: '',
            comPlete: true,
            jf: true,
            jfNum: '',
            fourIndex: undefined
        }
    },
    components: {
        rxFourTrain
    },
    computed: {
        ...mapGetters(['leftInfo', 'userInfo'])
    },
    created () {
        this.upGrade = this.$route.query.upGrade
        this.Levelrules(this.upGrade.leLevel)
    },
    methods: {
        Levelrules (level) {
            switch (Number(level)) {
            case 4:
                this.orderRates = false
                this.orderRatesNum = 0
                this.evaluation = false
                this.evaluationNum = 0
                this.deliveryRates = false
                this.deliveryRatesNum = 0
                this.workers = true
                this.workersNum = '5'
                this.delayRate = false
                this.delayRateNum = 0
                this.deferralRate = false
                this.deferralRateNum = 0
                this.raining = true
                this.rainingNum = '1次函授'
                this.securityOfficer = false
                this.securityOfficerNum = 0
                this.ziti = false
                this.zitiNum = 0
                this.xp = true
                this.xpNum = '10'
                this.zp = true
                this.zpNum = '10'
                this.cp = true
                this.cpNum = '5'
                this.rp = true
                this.rpNum = '5'
                this.comPlete = false
                this.jf = true
                this.jfNum = '60'
                break
            case 5:
                this.orderRates = false
                this.orderRatesNum = '90%'
                this.evaluation = true
                this.evaluationNum = 2
                this.deliveryRates = true
                this.deliveryRatesNum = '70%'
                this.workers = true
                this.workersNum = '10'
                this.delayRate = true
                this.delayRateNum = '20%'
                this.deferralRate = true
                this.deferralRateNum = '30%'
                this.raining = true
                this.rainingNum = '1'
                this.securityOfficer = false
                this.securityOfficerNum = 0
                this.ziti = false
                this.zitiNum = 0
                this.xp = true
                this.xpNum = '30'
                this.zp = true
                this.zpNum = '30'
                this.cp = true
                this.cpNum = '10'
                this.rp = true
                this.rpNum = '15'
                this.comPlete = true
                this.jf = true
                this.jfNum = '60'
                break
            case 6:
                this.orderRates = false
                this.orderRatesNum = '95%'
                this.evaluation = true
                this.evaluationNum = 4
                this.deliveryRates = true
                this.deliveryRatesNum = '75%'
                this.workers = true
                this.workersNum = '15'
                this.delayRate = true
                this.delayRateNum = '20%'
                this.deferralRate = true
                this.deferralRateNum = '25%'
                this.raining = true
                this.rainingNum = '1'
                this.securityOfficer = false
                this.securityOfficerNum = 0
                this.ziti = false
                this.zitiNum = 0
                this.xp = true
                this.xpNum = '50'
                this.zp = true
                this.zpNum = '50'
                this.cp = true
                this.cpNum = '25'
                this.rp = true
                this.rpNum = '20'
                this.comPlete = true
                this.jf = true
                this.jfNum = '60'
                break
            case 7:
                this.orderRates = true
                this.orderRatesNum = '95%'
                this.evaluation = true
                this.evaluationNum = 8
                this.deliveryRates = true
                this.deliveryRatesNum = '80%'
                this.workers = true
                this.workersNum = '2'
                this.delayRate = true
                this.delayRateNum = '20%'
                this.deferralRate = true
                this.deferralRateNum = '20%'
                this.raining = true
                this.rainingNum = '2'
                this.securityOfficer = true
                this.securityOfficerNum = '安全员'
                this.ziti = false
                this.zitiNum = 0
                this.xp = false
                this.xpNum = ''
                this.zp = false
                this.zpNum = ''
                this.cp = false
                this.cpNum = ''
                this.rp = false
                this.rpNum = ''
                this.comPlete = true
                this.jf = true
                this.jfNum = '60'
                break
            case 8:
                this.orderRates = true
                this.orderRatesNum = '95%'
                this.evaluation = true
                this.evaluationNum = 10
                this.deliveryRates = false
                this.deliveryRatesNum = ''
                this.workers = true
                this.workersNum = 3
                this.delayRate = true
                this.delayRateNum = '15%'
                this.deferralRate = true
                this.deferralRateNum = '20%'
                this.raining = true
                this.rainingNum = '2'
                this.securityOfficer = true
                this.securityOfficerNum = '安全员'
                this.ziti = false
                this.zitiNum = 0
                this.xp = false
                this.xpNum = ''
                this.zp = false
                this.zpNum = ''
                this.cp = false
                this.cpNum = ''
                this.rp = false
                this.rpNum = ''
                this.comPlete = true
                this.jf = true
                this.jfNum = '60'
                break
            case 9:
                this.orderRates = true
                this.orderRatesNum = '95%'
                this.evaluation = true
                this.evaluationNum = 12
                this.deliveryRates = false
                this.deliveryRatesNum = ''
                this.workers = true
                this.workersNum = 4
                this.delayRate = true
                this.delayRateNum = '15%'
                this.deferralRate = true
                this.deferralRateNum = '15%'
                this.raining = true
                this.rainingNum = '2'
                this.securityOfficer = true
                this.securityOfficerNum = '安全员'
                this.ziti = false
                this.zitiNum = 0
                this.xp = false
                this.xpNum = ''
                this.zp = false
                this.zpNum = ''
                this.cp = false
                this.cpNum = ''
                this.rp = false
                this.rpNum = ''
                this.comPlete = true
                this.jf = true
                this.jfNum = '60'
                break
            case 10:
                this.orderRates = true
                this.orderRatesNum = '95%'
                this.evaluation = true
                this.evaluationNum = 15
                this.deliveryRates = false
                this.deliveryRatesNum = ''
                this.workers = true
                this.workersNum = 1
                this.delayRate = true
                this.delayRateNum = '15%'
                this.deferralRate = true
                this.deferralRateNum = '15%'
                this.raining = true
                this.rainingNum = '3'
                this.securityOfficer = true
                this.securityOfficerNum = '安全员'
                this.ziti = false
                this.zitiNum = 0
                this.xp = false
                this.xpNum = ''
                this.zp = false
                this.zpNum = ''
                this.cp = false
                this.cpNum = ''
                this.rp = false
                this.rpNum = ''
                this.comPlete = true
                this.jf = true
                this.jfNum = '60'
                break
            case 11:
                this.orderRates = true
                this.orderRatesNum = '95%'
                this.evaluation = true
                this.evaluationNum = 20
                this.deliveryRates = false
                this.deliveryRatesNum = ''
                this.workers = true
                this.workersNum = 2
                this.delayRate = true
                this.delayRateNum = '10%'
                this.deferralRate = false
                this.deferralRateNum = ''
                this.raining = true
                this.rainingNum = '3'
                this.securityOfficer = true
                this.securityOfficerNum = '安全员/二建'
                this.ziti = true
                this.zitiNum = 1
                this.xp = false
                this.xpNum = ''
                this.zp = false
                this.zpNum = ''
                this.cp = false
                this.cpNum = ''
                this.rp = false
                this.rpNum = ''
                this.comPlete = true
                this.jf = true
                this.jfNum = '60'
                break
            case 12:
                this.orderRates = true
                this.orderRatesNum = '95%'
                this.evaluation = true
                this.evaluationNum = 25
                this.deliveryRates = false
                this.deliveryRatesNum = ''
                this.workers = true
                this.workersNum = 3
                this.delayRate = false
                this.delayRateNum = 0
                this.deferralRate = false
                this.deferralRateNum = ''
                this.raining = true
                this.rainingNum = '3'
                this.securityOfficer = true
                this.securityOfficerNum = '安全员/二建'
                this.ziti = true
                this.zitiNum = 3
                this.xp = false
                this.xpNum = ''
                this.zp = false
                this.zpNum = ''
                this.cp = false
                this.cpNum = ''
                this.rp = false
                this.rpNum = ''
                this.comPlete = true
                this.jf = true
                this.jfNum = '60'
                break
            default:
                break
            }
        },
        clickFourShow (index) {
            this.fourIndex = index
        }
    },
    watch: {
        $route () {
            this.upGrade = this.$route.query.upGrade
            this.Levelrules(this.upGrade.leLevel)
        }

    }
}

</script>
